package com.mohan.config;

import com.mohan.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

//@Configuration
public class MainConfig2 {
    @Bean(value = "person")
    /**
     * 指定创建模式为原型模式，每次都去创建一个新的
     */
    //@Scope("prototype")
    @Scope
    public Person person() {
        return new Person("莫大人",22);
    }
}
